home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 October / EnigmA AMIGA RUN 01 (1995)(G.R. Edizioni)(IT)[!][issue 1995-10][Aminet 7].iso / Aminet / comm / cnet / wtc1_5.lha / wtc1_5.rexx < prev   
OS/2 REXX Batch file  |  1995-04-24  |  4KB  |  107 lines

  1. /*
  2.                          -:- World Time Check v1.5 -:-
  3.    I will make a version that supports each and every time zone on the face
  4.             of the earth soon.  Just give me a little time. <Grin>
  5. */
  6.  
  7. Options results
  8. Changewhere 'World Time'
  9. Lhour =  Time();day = date();dow  = date('w');parse var lhour 1 hour 3 junk 4 min 6 junk1 7 secs +2;Local = time('H')
  10. /* Local offset from GMT 
  11. (I.E. -8 L.A., -7 denver, -6 chicago, -5 New York, 0 - london, 1 Germany + 10 sydney) */
  12.  
  13. admin = ':'min 
  14.  
  15. OS =  +10 /* Half zones note: round up for + times zones and down for - time zones. 
  16.              I don't know, test it out. */
  17.           
  18. MO =   0  /*  Minute Offset for those of you in "half time" zones    \
  19.           \  if you do not live in a half time zone, set this to 0  */
  20.  
  21.           
  22. if mo > 0 then call offset
  23.  
  24. test = 0;if test = 1 then do;Query 'Gmt = ';GMT = result;call gmtt;end
  25.  
  26. GMT = local - OS
  27.  
  28. gmtt:
  29. if GMT > 24 then do;GMT = GMT - 24;end
  30. if GMT < 0 then do;GMT = GMT + 24;end
  31. min = ':'min
  32.  
  33. Zones:
  34.  
  35. Tz = Gmt;call sub;ltz=tz;lta=ta
  36. TZ = GMT - 1;call sub;ztz =tz;zta=ta
  37. TZ = GMT - 2;call sub;Stz =tz;Sta=ta
  38. TZ = GMT - 3;call sub;Rtz =tz;Rta=ta
  39. TZ = GMT - 4;call sub;Btz =tz;Bta=ta
  40. TZ = GMT - 5;call sub;Etz =tz;Eta=ta
  41. TZ = GMT - 6;call sub;Ctz =tz;Cta=ta
  42. TZ = GMT - 7;call sub;Mtz =tz;Mta=ta
  43. TZ = GMT - 8;call sub;Ptz =tz;Pta=ta
  44. TZ = GMT - 9;call sub;Atz =tz;Ata=ta
  45. TZ = GMT - 10;call sub;Htz =tz;Hta=ta
  46. TZ = GMT - 11;call sub;ITZ = tz;ITa=ta
  47. TZ = GMT + 1;call pos;FTZ = tz;FTa=ta
  48. TZ = GMT + 2;call pos;OTZ = tz;oTa=ta
  49. TZ = GMT + 3;call pos;wTZ = tz;wTa=ta
  50. TZ = GMT + 4;call pos;tTZ = tz;tTa=ta
  51. TZ = GMT + 5;call pos;kTZ = tz;kTa=ta
  52. TZ = GMT + 6;call pos;NTZ = tz;nTa=ta
  53. TZ = GMT + 7;call pos;VTZ = tz;VTa=ta
  54. TZ = GMT + 8;call pos;qTZ = tz;qTa=ta
  55. TZ = GMT + 9;call pos;yTZ = tz;yTa=ta
  56. TZ = GMT + 10;call pos;xTZ = tz;xTa=ta
  57. TZ = GMT + 11;call pos;jTZ = tz;jTa=ta
  58. TZ = GMT + 12;call pos;dTZ = tz;dTa=ta
  59. Display:
  60.  
  61. transmit 'f1n2 z1cf'center('-:- World Time Clock v 1.5a -:-',78)'z0n1'
  62. transmit ' z4        cfLondon      'right(LTZ||MIN||LTA,7)'           z0 z4          cfBerlin       'right(ftz||MIN||FTA,7)'         z0'
  63. transmit '         ceAzores      'right(ZTZ||MIN||ZTA,7)'                      ceCairo        'right(otz||MIN||oTA,7)
  64. transmit ' z4        cfGrytviken   'right(STZ||MIN||STA,7)'           z0 z4          cfMoscow       'right(wtz||MIN||wTA,7)'         z0'
  65. transmit '         ceRio         'right(RTZ||MIN||RTA,7)'                      ceTeheran      'right(Ttz||MIN||TTA,7)
  66. transmit ' z4        cfBermuda     'right(BTZ||MIN||BTA,7)'           z0 z4          cfKarachi      'right(Ktz||MIN||KTA,7)'         z0'
  67. Transmit '         ceNew York    'right(ETZ||MIN||ETA,7)'                      ceTashkent     'right(ntz||MIN||nTA,7)
  68. Transmit ' z4        cfChicago     'right(CTZ||MIN||CTA,7)'           z0 z4          cfJakarta      'right(vtz||MIN||vTA,7)'         z0'
  69. Transmit '         ceDenver      'right(MTZ||MIN||MTA,7)'                      ceBeijing      'right(qtz||MIN||qTA,7)
  70. Transmit ' z4        cfLos Angeles 'right(PTZ||MIN||PTA,7)'           z0 z4          cfTokyo        'right(ytz||MIN||yTA,7)'         z0'
  71. Transmit '         ceAnchorage   'right(ATZ||MIN||ATA,7)'                      ceSydney       'right(xtz||MIN||xTA,7)
  72. Transmit ' z4        cfHonolulu    'right(HTZ||MIN||HTA,7)'           z0 z4          cfCaroline is. 'right(jtz||MIN||jTA,7)'         z0'
  73. Transmit '         ceMidway Is.  'right(ITZ||MIN||ITA,7)'                      ceMarshall is. 'right(dtz||MIN||dTA,7)
  74. transmit 'n1 cf        Local Time cb'right(time(),9)'              cfLocal Date:c3 'day', a 'DOW'n1'
  75.  
  76.  transmit 'c3Press any key...g0'
  77.  exit
  78.  
  79.  sub:
  80.  TA = 'am'
  81.    if TZ < 0 then do; TZ = TZ + 24; end
  82.    if TZ = 24 then do;tz = tz -24;TA='am';end
  83.    if TZ > 12 then do;TZ = TZ - 12 ;TA='pm';end
  84.    if TZ = 12 then do;TA = 'pm';end
  85.    if TZ = 0 Then TZ = 12
  86.  
  87.  return
  88.  
  89. Pos:
  90.  
  91. TA = 'am'
  92.  if TZ > 24  then do; TZ = TZ - 24; end
  93.  if TZ = 24  then do; TZ = TZ - 24; end
  94.   if TZ > 12 then do;TZ = TZ - 12 ;TA='pm';end
  95.    if TZ = 12 then do;TA = 'pm';end
  96.   if TZ = 0 Then TZ = 12
  97.  
  98. return
  99.  
  100. offset:
  101. min = min + mo
  102. if min > 60 then do ;min = min - 60;os=os-1;end
  103. if min = 0 then min = '00'
  104. if min <10 then min = '0'min
  105. if min = 60 then do;min = '00';os = os -1;end
  106. return
  107.